﻿<?php
include_once(dirname(__FILE__).'/MarketTree.class.php');
class SubTree extends MarketTree{
    function __construct($pid){
        parent::__construct($pid);
    }
    protected function getSql(){
        if($this->getPid() == 0)
            $str = "parentGroupID is null";
        else
            $str = "parentGroupID = ".$this->getPid();
        $sql = "SELECT marketGroupID,text,hasTypes 
            FROM invmarketgroups,trntranslations 
            where ".$str." and marketGroupID = keyID and languageID = 'zh' 
            and tcID = (select tcID from trntranslationcolumns 
            where columnName = 'marketGroupName');";
        return $sql;
    }
    protected function getTreeSubItem($row){
        $sub_item = array('id'=>$row->marketGroupID,
            'name'=>$row->text,
            'hastypes'=>$row->hasTypes);
        return $sub_item;
    }
}
?>
